package com.rt.easyjava.common.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
  * @author wuxiaoyong
  * @since 2020-06-13
 */
public enum TmptAuthPosition {
    BigManager(100, "大队长"),
    MidManger(90, "中队长"),
    MidManger1(89, "教导员"),
    MidManger2(88, "副中队长协管"),
    MidManger3(87, "副中队长勤务"),
    MidManger4(86, "副中队长督查信访"),
    MidManger5(85, "副中队长"),
    MidManger6(84, "分队长案审勤务"),
    MidManger7(83, "分队长（社区）"),
    SmallManger(80, "小队长"),
    SmallManger1(79, "副小队长"),
    SmallManger2(78, "干事"),
    SmallManger3(77, "内勤"),
    SmallManger4(76, "案审"),
    SmallManger5(75, "案审窗口"),
    SmallManger6(74, "信息化专员"),
    Member(0, "队员"),
    Member1(-1, "外借街道"),
    Member2(-2, "外借综管办");

    private final Integer id;
    private final String name;

    TmptAuthPosition(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static String explain(Integer id) {
        return explain(id, null) ;
    }

    public static String explain(Integer id, String unexpectedValue) {
        for (TmptAuthPosition enum1 : TmptAuthPosition.values()) {
            if (enum1.id.equals(id)) {
                return enum1.getName();
            }
        }
        return unexpectedValue;
    }

    public static List<Map<String,Object>> toList () {
        List <Map<String,Object>> list = new ArrayList();
        for (TmptAuthPosition enum1 : TmptAuthPosition.values()) {
            Map<String,Object> map = new HashMap();
            map.put("id", enum1.getId());
            map.put("name", enum1.getName());
            list.add(map);
        }
        return list;
    }

    public Integer getId() {
        return id;
    }

    public String getName() {
        return name;
    }

}
